/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author mosipdkara
 */
@Entity
@Table(name = "masteris")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Masteris.findAll", query = "SELECT m FROM Masteris m"),
    @NamedQuery(name = "Masteris.findByMasterIsId", query = "SELECT m FROM Masteris m WHERE m.masterIsId = :masterIsId"),
    @NamedQuery(name = "Masteris.findByMasterIsAdi", query = "SELECT m FROM Masteris m WHERE m.masterIsAdi = :masterIsAdi"),
    @NamedQuery(name = "Masteris.findByMasterIsAciklama", query = "SELECT m FROM Masteris m WHERE m.masterIsAciklama = :masterIsAciklama")})
public class Masteris implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "MasterIsId")
    private Integer masterIsId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 145)
    @Column(name = "MasterIsAdi")
    private String masterIsAdi;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 245)
    @Column(name = "MasterIsAciklama")
    private String masterIsAciklama;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "masterIsId")
    private List<Detayis> detayisList;

    public Masteris() {
    }

    public Masteris(Integer masterIsId) {
        this.masterIsId = masterIsId;
    }

    public Masteris(Integer masterIsId, String masterIsAdi, String masterIsAciklama) {
        this.masterIsId = masterIsId;
        this.masterIsAdi = masterIsAdi;
        this.masterIsAciklama = masterIsAciklama;
    }

    public Integer getMasterIsId() {
        return masterIsId;
    }

    public void setMasterIsId(Integer masterIsId) {
        this.masterIsId = masterIsId;
    }

    public String getMasterIsAdi() {
        return masterIsAdi;
    }

    public void setMasterIsAdi(String masterIsAdi) {
        this.masterIsAdi = masterIsAdi;
    }

    public String getMasterIsAciklama() {
        return masterIsAciklama;
    }

    public void setMasterIsAciklama(String masterIsAciklama) {
        this.masterIsAciklama = masterIsAciklama;
    }

    @XmlTransient
    public List<Detayis> getDetayisList() {
        return detayisList;
    }

    public void setDetayisList(List<Detayis> detayisList) {
        this.detayisList = detayisList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (masterIsId != null ? masterIsId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Masteris)) {
            return false;
        }
        Masteris other = (Masteris) object;
        if ((this.masterIsId == null && other.masterIsId != null) || (this.masterIsId != null && !this.masterIsId.equals(other.masterIsId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Masteris[ masterIsId=" + masterIsId + " ]";
    }
    
}
